//
//  CustomButton.h
//  OCStarterProject
//
//  Created by huaya on 2025/10/2.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, CustomButtonStyle) {
    CustomButtonStylePrimary,
    CustomButtonStyleSecondary,
    CustomButtonStyleDanger,
    CustomButtonStyleSuccess
};

@interface CustomButton : UIButton

/// 按钮样式
@property (nonatomic, assign) CustomButtonStyle buttonStyle;

/// 是否显示加载状态
@property (nonatomic, assign) BOOL isLoading;

/// 按钮点击回调
@property (nonatomic, copy) void (^onTap)(void);

/// 初始化方法
- (instancetype)initWithFrame:(CGRect)frame style:(CustomButtonStyle)style;

/// 设置按钮标题
- (void)setButtonTitle:(NSString *)title;

/// 设置按钮图标
- (void)setButtonIcon:(UIImage *)icon;

/// 开始加载动画
- (void)startLoading;

/// 停止加载动画
- (void)stopLoading;

@end

NS_ASSUME_NONNULL_END
